import { Region, Currency, CurrencySymbol } from '@/enums'
import { t } from '@/utils'

export const getRegionList = () => [
	{
		id: Region.tha,
		text: t('Region.tha') + ` [${Currency.tha}]`,
		icon: `region/${Region.tha}.svg`
	},
	{
		id: Region.vn,
		text: t('Region.vn') + ` [${Currency.vn}]`,
		icon: `region/${Region.vn}.svg`
	},
	{
		id: Region.idn,
		text: t('Region.idn') + ` [${Currency.idn}]`,
		icon: `region/${Region.idn}.svg`
	},
	{
		id: Region.my,
		text: t('Region.my') + ` [${Currency.my}]`,
		icon: `region/${Region.my}.svg`
	},
	{
		id: Region.un,
		text: t('Region.un') + ` [${Currency.un}]`,
		icon: `region/${Region.un}.svg`
	}
]

export const getCurrency = (region: Region) => {
	switch (region) {
		case Region.tha:
			return Currency.tha
		case Region.vn:
			return Currency.vn
		case Region.idn:
			return Currency.idn
		case Region.my:
			return Currency.my
		case Region.un:
			return Currency.un
	}
}

export const getCurrencySymbol = (region: Region) => {
	switch (region) {
		case Region.tha:
			return CurrencySymbol.tha
		case Region.vn:
			return CurrencySymbol.vn
		case Region.idn:
			return CurrencySymbol.idn
		case Region.my:
			return CurrencySymbol.my
		case Region.un:
			return CurrencySymbol.un
	}
}
